package com.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pojo.Staff;
import com.vo.StaffVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author: T-bao
 * @Date: 2021-3-25 15:09
 * @Description:
 */
public interface StaffDAO extends BaseMapper<Staff> {

    @Select("select * from staff where sfz not like '$#%' and sfz is not null and sfz!=''")
    List<Staff>  getAllNotEncryptSfz();

    List<StaffVO> shenheStaff(String name, int page, @Param("size") int limit);

    int shenhecount(String name);

    List<StaffVO> selectStaff(String name, int page, @Param("size") int limit);

    int count(String name);

    List<StaffVO> kuaidaoqiStaff(String name, int page, @Param("size") int limit, Date time, Date cstime);

    int kdqcount(String name,Date time,Date cstime);

    List<StaffVO> yidaoqiStaff(String name, int page, @Param("size") int limit, Date time);

    int ydqcount(String name,Date time);

    IPage<StaffVO> selectByQyWy(Page page , @Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status, @Param("zhiye") String zhiye, @Param("guoji") String guoji, @Param("queryStr") String queryStr, @Param("zyNameList") List<String> zyNameList, @Param("ids") List<String> ids) ;

    int selectCountByQyWy(@Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status, @Param("zhiye") String zhiye, @Param("guoji") String guoji, @Param("queryStr") String queryStr, @Param("zyNameList") List<String> zyNameList, @Param("ids") List<String> ids) ;

    List<Staff> selectByExport(@Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("zhiye") String zhiye, @Param("guoji") String guoji, @Param("queryStr") String queryStr, @Param("zyNameList") List<String> zyNameList, @Param("ids") List<String> ids);

    IPage<Staff> selectByGp(Page page , @Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status, @Param("zkFlag") String zkFlag, @Param("zhiye") String zhiye, @Param("dataFlag") String dataFlag, @Param("queryStr") String queryStr, @Param("zyNameList") List<String> zyNameList) ;

    IPage<Staff> selectByGpByProblemData(Page page , @Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status, @Param("zkFlag") String zkFlag, @Param("zhiye") String zhiye) ;

    List<StaffVO> exportExcelByGp(@Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status, @Param("zkFlag") String zkFlag, @Param("zhiye") String zhiye, @Param("dataFlag") String dataFlag, @Param("queryStr") String queryStr, @Param("zyNameList") List<String> zyNameList) ;

    IPage<Staff> selectByKk(Page page , @Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status, @Param("cardNo") String cardNo, @Param("zhiye") String zhiye, @Param("queryStr") String queryStr, @Param("zyNameList") List<String> zyNameList) ;
    IPage<Staff> selectByShbk(Page page , @Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status) ;
    IPage<StaffVO> selectStaffByCard(Page page, @Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status, @Param("cardStatus") String cardStatus, @Param("queryStr") String queryStr, @Param("zyNameList") List<String> zyNameList) ;
    public IPage<Staff> staffListByWy(Page page , @Param("wy") String wy) ;

    IPage<Staff> selectStaffByCard1(Page page , @Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status) ;

    int clearCard(@Param("id") String id) ;

    List<StaffVO> exportExcelByProblemData(@Param("queryStr") String queryStr, @Param("zyNameList") List<String> zyNameList);

    List<Map<String, Long>>  getGuojiCount();


    IPage<StaffVO> getStaffTrail(Page page , @Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("days") String days);

    List<StaffVO> getStaffTrailByExport(@Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("days") String days);

    IPage<StaffVO> selectByQrCode(Page page, @Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status, @Param("zhiye") String zhiye, @Param("qrCode") String qrCode) ;

    IPage<StaffVO> selectStaffWhiteList(Page page, @Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status, @Param("zhiye") String zhiye, @Param("whiteList") String whiteList, @Param("qrCode") String qrCode, @Param("queryStr") String queryStr, @Param("zyNameList") List<String> zyNameList) ;
    List<StaffVO> exportStaffWhiteList(@Param("name") String name , @Param("wuye") String wuye , @Param("qiye") String qiye, @Param("status") int status, @Param("zhiye") String zhiye, @Param("whiteList") String whiteList, @Param("qrCode") String qrCode, @Param("queryStr") String queryStr, @Param("zyNameList") List<String> zyNameList) ;
}
